import { createSSRApp } from "vue";
import App from "./App";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

export function createApp() {
  const app = createSSRApp(App);

  // 创建pinia实例
  const pinia = createPinia();
  // 使用持久化插件，配置为使用uni-app的存储API
  pinia.use(piniaPluginPersistedstate);

  app.use(pinia);

  return {
    app,
  };
}
